import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class Widget_CupertinoButton_Page extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text("CupertinoButton"),
        ),
        body: Center(
          child: CupertinoButton(
            child: Text("按钮",
              style: TextStyle(
                color: Colors.white,
              ),
            ),
            disabledColor: Colors.blue,
            color: Colors.green,
            onPressed: (){},
//            onPressed: null,
            pressedOpacity: 0.9,
          ),
        )
      ),
    );
  }
}

/**
 *  ios风格的按钮
 *  onPressed: null,时按钮不可用
 *
 * const CupertinoButton({
    @required this.child,
    this.padding,//内边距
    this.color,//可用时按钮颜色
    this.disabledColor,//不可用时按钮颜色
    this.minSize = 44.0,//按钮最小尺寸
    this.pressedOpacity = 0.1,//按下是按钮透明度是原来的多少，不能大于1
    this.borderRadius = const BorderRadius.all(Radius.circular(8.0)),//按钮圆角大小
    @required this.onPressed,//按下的回调
    })
 */
